package com.ruoyi.common.utils;

import sun.misc.BASE64Encoder;

import java.io.UnsupportedEncodingException;

public final class Base64 {

    public static String encode(String s){//转码
        String res="";
        try {
            res= new BASE64Encoder().encode(s.getBytes("utf-8"));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return  res;
    }
}
